#!/usr/bin/env node
console.log(process.pid);
const cp = require('child_process');
console.log(`I am father,PID:${process.pid}`);
const son = cp.fork('./11-ipc-child.js');
const dau = cp.fork('./11-ipc-child.js');

son.on('message',(msg)=>{
  console.log(`I have a son with PID:${msg}`);
})
dau.on('message',(msg)=>{
  console.log(`I have a dau with PID:${msg}`);
})


son.send('work hard');
dau.send('good study');
